<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Acount Model Config</title>
	
	<jsp:include page="/core/tool/resources.jsp"></jsp:include>
	<script src="./detailreport.js"></script>

</head>
<body>

	<div id="toolbar" style="font-size: 12px">
	   <a class="easyui-linkbutton" iconCls="icon-reload" onclick="refresh()">刷新</a> 
       <a class="easyui-linkbutton" iconCls="icon-reload" onclick="refreshForce()">强制刷新</a>
       <a class="easyui-linkbutton" onclick="refresh('lastDay')">前一天</a> 
       <a class="easyui-linkbutton" onclick="refresh('nextDay')">后一天</a>
      	&nbsp;&nbsp;&nbsp;&nbsp;刷新间隔:<input id="autoRefreshForceInterval" class="easyui-numberspinner" style="width:60px" data-options="value:10,min:5,max:20"/>
        &nbsp;自动刷新:<input id="autoRefreshForce" class="easyui-switchbutton" data-options="value:'off',onChange:autoRefreshForce"/>
       <br/>
       <form id="ff" class="easyui-flexform" data-options="cellWidth:210,cellMargin:2,labelWidth:0,labelAlign:'right'">
      		<div>
				<label>账户:</label>
		 		<div><input id="acountId" class="easyui-combobox"  name="acountId" 
		 			data-options="url:'../acount/allenabled.json',
		 				textField:'acountName',
		 				valueField:'acountId',
		 				onChange:changeAcount,
		 				loadFilter:function(data){return data.acounts},
		 				value:${acountId}"/></div>
		 	</div>
			<div>
				<label>回测日期:</label>
				<div><input class="easyui-datebox" type="text" name="summaryDate" id="summaryDate" data-options="onChange:changeSummaryDate,onSelect:userSelect"/></div>
			</div>
			<div>
				<label>运行时间:</label>
				<div><input class="easyui-datetimebox" name="runTime" data-options="readonly:true"/></div>
			</div>
			<div>
				<label>平均评级:</label>
				<div><input class="easyui-numberbox" name="avgRating" data-options="readonly:true,precision:4"/></div>
			</div>
			<div>
				<label>市值:</label>
				<div><input class="easyui-numberbox" name="marketValue" data-options="readonly:true"/></div>
			</div>
			<div>
				<label>现金:</label>
				<div><input class="easyui-numberbox" name="cash" data-options="readonly:true"/></div>
			</div>
			<div>
				<label>总收益%:</label>
				<div><input class="easyui-numberbox" name="profit" data-options="readonly:true,precision:2,measure:'percent'"/></div>
			</div>
			<div>
				<label>总收益:</label>
				<div><input class="easyui-numberbox" name="profitMoney" data-options="readonly:true"/></div>
			</div>
			<div>
				<label>当日收益%:</label>
				<div><input class="easyui-numberbox" name="profitDay" data-options="readonly:true,precision:2,measure:'percent'"/></div>
			</div>
			<div>
				<label>当日收益:</label>
				<div><input class="easyui-numberbox" name="profitDayMoney" data-options="readonly:true"/></div>
			</div>
			<div id="runLog" colspan=4 style="display:none">
				<label>运行日志:</label>
				<div><input class="easyui-textbox" name="runLog" data-options="readonly:true,multiline:true,height:60" /></div>
			</div>
		</form>  
	</div>

	<table id="bill" class="easyui-edatagrid" style="width:100%" 
		data-options="rownumbers:true,singleSelect:false,sortOrder:'asc', sortName:'billTime', remoteSort:false, editing:false">
        <thead>
            <tr>
           	 	<th data-options="field:'billTime',width:150,order:'desc',editor:'datetimebox', sortable:true">交易时间</th>
                <th data-options="field:'billType',width:80, formconfig:{type:'combobox',options:{flexset:'TRADE_TYPE'}}">类别</th>
                <th data-options="field:'secId',width:80">代码</th>
                <th data-options="field:'secName', width:100 ">名称</th>
                <th data-options="field:'billMoney',width:80,align:'right', editor:{type:'numberbox',options:{precision:2}}">交易金额</th>
                <th data-options="field:'billTradeMoney',width:80,align:'right', editor:{type:'numberbox',options:{precision:2}}">交易净额</th>
                <th data-options="field:'secNum',width:80,align:'right',editor:'numberbox',styler:profitStyle">数量</th>
                <th data-options="field:'secPrice',width:80,align:'right',editor:{type:'numberbox',options:{precision:3}}">价格</th>
                <th data-options="field:'tradeDiscount',width:80,align:'right',editor:{type:'numberbox',options:{precision:3}}">交易折价</th>
                <th data-options="field:'bondInterest',width:80,align:'right',editor:{type:'numberbox',options:{precision:2}}">利息</th>
                <th data-options="field:'feeCommision',width:80,align:'right',editor:{type:'numberbox',options:{precision:2}}">佣金</th>
                <th data-options="field:'feeTax',width:80,align:'right',editor:{type:'numberbox',options:{precision:2}}">印花</th>
                <th data-options="field:'feeOther',width:80,align:'right',editor:{type:'numberbox',options:{precision:2}}">其它</th>
                <th data-options="field:'feeAll',width:80,align:'right',editor:{type:'numberbox',options:{precision:2}}">费用合计</th>
                <th data-options="field:'billDesc',width:300">说明</th>
            </tr>
        </thead>
    </table>

	<table id="dg"  class="easyui-edatagrid" style="width:100%"
		data-options="rownumbers:true,singleSelect:true, remoteSort:false, multiSort:${multiSort==null?false:true}, sortName:'${sortName}', sortOrder:'${sortOrder}'">
		<thead data-options="frozen:true">
			<tr>           	 	
				<th data-options="field:'secName',width:85, sortable:true">名称</th>
				<th data-options="field:'secId',  width:80, sortable:true">代码</th>
			</tr>
		</thead>
        <thead>
            <tr>
           	 	<th data-options="field:'rating', width:70, align:'right', formconfig:{type:'numberbox',options:{precision:4}}, sortable:true ">评级</th>
           	 	<th data-options="field:'position', width:70, align:'right'">持仓</th>
           	 	<th data-options="field:'trade', width:70, align:'right'">操作</th>
           	 	<th data-options="field:'price',  width:70, align:'right', formconfig:{type:'numberbox',options:{precision:3}}">价格</th>
           	 	<th data-options="field:'priceChp', width:70, align:'right', formconfig:{type:'numberbox',options:{precision:2,measure:'percent'}}, styler:profitStyle,sortable:true">涨幅%</th>
         		<c:forEach var="item" items="${model}">
                	<th data-options="field:'${item.fieldName}', ${item.format}">${item.name}</th>
				</c:forEach>
            </tr>
        </thead>
    </table>

</body>
</html>